//
//  PubLishView.m
//  TheRoadAD
//
//  Created by baixue on 16/8/8.
//  Copyright © 2016年 baixue. All rights reserved.
//

#import "PubLishView.h"
#import "HyPopMenuView.h"
#import "TwoViewController.h"
#import "PopMenuButton.h"

@interface PubLishView ()<HyPopMenuViewDelegate>
@property (nonatomic, strong) HyPopMenuView* menu;
@property (nonatomic,strong) PopMenuButton *button;
@end

@implementation PubLishView

-(id)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        
         _menu = [HyPopMenuView sharedPopMenuManager];
        
        PopMenuModel* model = [PopMenuModel
                               allocPopMenuModelWithImageNameString:@"tabbar_compose_idea"
                               AtTitleString:@"照片/视频"
                               AtTextColor:[UIColor grayColor]
                               AtTransitionType:PopMenuTransitionTypeCustomizeApi
                               AtTransitionRenderingColor:nil];
        
        
        PopMenuModel* model1 = [PopMenuModel
                                allocPopMenuModelWithImageNameString:@"tabbar_compose_photo"
                                AtTitleString:@"活动"
                                AtTextColor:[UIColor grayColor]
                                AtTransitionType:PopMenuTransitionTypeSystemApi
                                AtTransitionRenderingColor:nil];
        
        PopMenuModel* model2 = [PopMenuModel
                                allocPopMenuModelWithImageNameString:@"tabbar_compose_camera"
                                AtTitleString:@"改装"
                                AtTextColor:[UIColor grayColor]
                                AtTransitionType:PopMenuTransitionTypeCustomizeApi
                                AtTransitionRenderingColor:nil];
        
        PopMenuModel* model3 = [PopMenuModel
                                allocPopMenuModelWithImageNameString:@"tabbar_compose_lbs"
                                AtTitleString:@"车模"
                                AtTextColor:[UIColor grayColor]
                                AtTransitionType:PopMenuTransitionTypeSystemApi
                                AtTransitionRenderingColor:nil];
        
        PopMenuModel* model4 = [PopMenuModel
                                allocPopMenuModelWithImageNameString:@"tabbar_compose_review"
                                AtTitleString:@"心情"
                                AtTextColor:[UIColor grayColor]
                                AtTransitionType:PopMenuTransitionTypeCustomizeApi
                                AtTransitionRenderingColor:nil];
        
        PopMenuModel* model5 = [PopMenuModel
                                allocPopMenuModelWithImageNameString:@"tabbar_compose_more"
                                AtTitleString:@"我要维权"
                                AtTextColor:[UIColor grayColor]
                                AtTransitionType:PopMenuTransitionTypeSystemApi
                                AtTransitionRenderingColor:nil];
        
        _menu.dataSource = @[ model, model1, model2, model3, model4, model5 ];
        _menu.popMenuSpeed = 12.0f;
        _menu.delegate = self;
        _menu.automaticIdentificationColor = false;
        _menu.animationType = HyPopMenuViewAnimationTypeViscous;
        
        
       
        _menu.backgroundType = HyPopMenuViewBackgroundTypeLightBlur;
        [_menu openMenu];
        
    }
    return self;
}


- (void)popMenuView:(HyPopMenuView*)popMenuView didSelectItemAtIndex:(NSUInteger)index{
    NSLog(@"jdgk");
//     [self.navigationController popViewControllerAnimated:false];
}


@end
